/*=====================================================================

  File:      RegisterFileBlobStore.sql
  Summary:   Registers the File Blob Store into the RBS database.
  Date:      7/10/2008

---------------------------------------------------------------------

  This file is part of the Microsoft SQL Server Code Samples.
  Copyright (C) Microsoft Corporation.  All rights reserved.

 This source code is intended only as a supplement to Microsoft
Development Tools and/or on-line documentation.  See these other
materials for detailed information regarding Microsoft code samples.

THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

======================================================= */


declare @configXml xml,
        @blob_store_id smallint

-- Xml config describing the blob store to be added.
set @configXml = N'
<blob_store_config> 
    <common>
        <blob_store_type> File </blob_store_type> 
        <backend_blob_store_version> 1.0.0.0 </backend_blob_store_version> 
        <min_provider_version_supported> 1.0.0.0 </min_provider_version_supported> 
        <blob_store_location> @LOCATION@ </blob_store_location> 
    </common>
    <extended>
        <config_item_list>
            <config_item key = "pool_capacity" value = "@CAPACITY@" />
        </config_item_list>
    </extended> 
</blob_store_config>'

-- Call the SP to add a blob store.
execute mssqlrbs.rbs_sp_add_blob_store N'@NAME@', @configXml, @blob_store_id output
go
